<?php
/**
 * Eren Framework
 * 
 * Only entrance of this system
 * 
 * @category System
 * @author Steve Liu
 * @copyright Eshifang (http://www.eshifang.com)
 */

/*
 * Init environment
 */
error_reporting(E_ALL);
ini_set('display_errors', 'On');
date_default_timezone_set('Asia/Shanghai');
define('PROJECT_PATH', dirname(__FILE__) . '/');
require_once PROJECT_PATH . 'Library/Eren/AutoLoad.php';

//定义常用宏
define('HOST', Eren_Request_URL::getHost());
define('STATIC_PATH', 'http://' . HOST . '/Static/');
define('JS_VERSION', 1);
define('CSS_VERSION', 1);

//注册数据库
Eren_Registry::set('DB', Eren_DB::factory('Eren_DB_MySQL', Web_Config_DB::getConfig()));

//初始化Session，使用默认session处理
Eren_Registry::set('SESSION', Eren_Session::factory());

//是否自动登录
Web_Model_Member::autoSignIn();

/*
 * Init PlugIn
 */
Eren_PlugIn::regist(new Web_PlugIn_Init);

/*
 * Start dispatch
 */
Eren_Front::getInstance()->setModel('Web')->dispatch();
exit;